﻿using System;

namespace SUMO.MediaBrowser.Foundation
{
    /// <summary>
    /// Interface for different kind of file uploaders
    /// </summary>
    public interface IFileUploader
    {
        /// <summary>
        /// Starts the upload
        /// </summary>
        /// <param name="uploadedFileProcessorType"></param>
        void StartUpload(string uploadedFileProcessorType);

        /// <summary>
        /// Fired when the upload has successfully finished.  The uploader will not access the UserFile object after this is invoked.
        /// </summary>
        event EventHandler UploadFinished;

        /// <summary>
        /// An upload has been successfully canceled.  The uploader will not access the UserFile object after this is invoked.
        /// </summary>
        event EventHandler UploadCancelled;

        /// <summary>
        /// An error has occurred.  The upload aborts, and the UserFile is not accessed after this is invoked.
        /// </summary>
        event EventHandler<UploadErrorOccurredEventArgs> UploadErrorOccurred;

        /// <summary>
        /// Called each time data is sent to the server, and provides the total amount sent so far.
        /// </summary>
        event EventHandler<UploadDataSentArgs> UploadDataSent;

        /// <summary>
        /// Post-processing of the file has started.
        /// </summary>
        event EventHandler UploadProcessingStarted;
    }
}